package XPStruct;

//机位选择时的 结构信息
public class SeatI {
    private String      description;
    private final int   port;

    //读取端口
    public int getPort(){
        return port;
    };

    @Override
    public String toString() {
        return description;
    }

    //转换成调试端口
    private int _toSeatPort(int seat_index){
        return 8000 + seat_index;
    }

    public SeatI( int seat_index ){
        //转换机位到端口
        port = _toSeatPort(seat_index);
        //格式化展示内容
        description = String.format("机位编号 = #%-3d, 调试端口 = %d",
                                            seat_index + 1, port);
    }
}

